<?php
/**
 * Unfuddle Subscription Model
 * Tells Unfuddle which tickets a user should receive updates about.
 *
 * @package     Unfuddle
 * @subpackage  Data Models
 * @author      Luke Visinoni <luke.visinoni@gmail.com>
 * @copyright   (c) 2010 Luke Visinoni <luke.visinoni@gmail.com>
 * @version     $Id: Subscription.php 29 2011-05-09 07:08:53Z luke.visinoni $
 */
class Unfuddle_Model_Subscription extends Unfuddle_Model_Abstract {

    const URI_SUBSCRIPTIONS = 'projects/{project_id}/tickets/{ticket_id}/subscriptions';
    
    const URI_SUBSCRIPTION_BY_ID = 'projects/{project_id}/tickets/{ticket_id}/subscriptions/{subscription_id}';
    
    const URI_SUBSCRIBE = 'projects/{project_id}/tickets/{ticket_id}/subscribe';
    
    const URI_UNSUBSCRIBE = 'projects/{project_id}/tickets/{ticket_id}/unsubscribe';
    
    /**
     * @var string Model name
     */
    protected $_name = 'subscription';
    
    /**
     * @var array Model fields
     */
    protected $_fields = array (
        'created-at' => array('type' => 'datetime', 'required' => false, 'read-only' => true),
        'id' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'parent-id' => array('type' => 'integer', 'required' => false, 'read-only' => true),
        'parent-type' => array('type' => 'set', 'required' => false, 'read-only' => true, 'set' => array('ticket')),
        'person-id' => array('type' => 'integer', 'required' => false, 'read-only' => false),
        'updated-at' => array('type' => 'datetime', 'required' => false, 'read-only' => true),
    );

}
